<form id="pagerForm" method="post" action="{:U($module_name.'/'.$action_name)}">
    <input type="hidden" name="pageNum" value="{$pageNum}" />
	<input type="hidden" name="numPerPage" value="{$numPerPage}" />
	<input type="hidden" name="orderField" value="{$orderField}" />
	<input type="hidden" name="orderDirection" value="{$orderDirection}" />
	<input type="hidden" name="keywords" value="{$keywords}" />
	<input type="hidden" name="sfield" value="{$$wherefields}" />
	<input type="hidden" name="sfield_name" value="id,name" />
	<input name="mname" type="hidden" value="{$mname}" />
</form>
<div class="pageHeader">
    <form rel="pagerForm" onsubmit="return navTabSearch(this);" action="{:U($module_name.'/'.$action_name)}" method="post">
        <input name="mname" type="hidden" value="{$mname}" />
        <div class="searchBar">
            <ul class="searchContent">
                <li style="width:200px;">
                    <label style="width: 50px;">
                        关键字：
                    </label>
                    <input type="text" name="keywords" value="{$keywords}" style="width: 120px;"/>
                </li>
                <li style="width: 100px;">
                    <select class="combox" name="sfield">
                        <option value="all" {if $wherefields=='all'}selected="selected"{/if}>全部</option>
                        <option value="id" {if $wherefields=='id'}selected="selected"{/if}>商品ID</option>
                        <option value="name" {if $wherefields=='name'}selected="selected"{/if}>商品名称</option>
                    </select>
                    <input type="hidden" name="sfield_name" value="id,name" />
                </li><!--
                <li>
                状态：
                <select name="status">
                <option value='1' selected>进行中</option>
                <option value='0'>已结束</option>
                </select>
                </li>
                -->
                <li style="padding-top:0;">
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                搜索
                            </button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li>
                <a class="edit" href="{:U('Content/add',array('catid'=>$catid))}&&id={sid_dv}" target="navTab" rel="Content_add_edit" warn="请选择一条数据"><span>修改信息</span></a>
            </li>
            <li class="line">
                line
            </li>
            <li>
                <a class="icon" href="javascript:$.printBox('w_list_print')"><span>打印</span></a>
            </li>
            <li class="line">
                line
            </li>
            <li>
				<a href="{:U('Content/attribute_s',array('todo'=>'adddel'))}" target="dialog" id="forstautss2" style="display:none;">.</a>
				<a target="selectedTodo" rel="ids[]" href="{:U('Product/mname',array('ftodo'=>'view'))}" class="add"><span>批量修改模板</span></a>				
                <!--    <select name="" id="supp">
                <option value="">请选择供应商</option>
                <volist name="suppliers" id="s">
                <option value="{$s['id']}">{$s['name']}</option>
                </volist>
                </select>
                -->
            </li>
            <!--
            <li class="line">
            line
            </li>
            <li>
            <a href="{:U('Product/updatecat')}"><span>更新产品分类</span></a>
            </li>
            -->
        </ul>
    </div>
    <div id="w_list_print">
        <table class="list" width="100%" targetType="navTab" asc="asc" desc="desc" layoutH="93">
            <thead>
                <tr>
                    <th width="22">
                        <input type="checkbox" group="ids[]" class="checkboxCtrl">
                    </th>
                    <th width="40" orderField="id" {if $orderField=='id'}class="{$orderDirection}"{/if}>
 ID
                    </th>
                    <th>
                        名称
                    </th>
					<th>
                        模型
                    </th>
                    <th>
                        分类
                    </th>
                    <th>
                        品牌
                    </th>
                    <th orderField="price" {if $orderField=='price'}class="{$orderDirection}"{/if}>
 均价
                    </th>
                    <th>
                        状态
                    </th>
                    <th width="120">
                        管理操作
                    </th>
                    <!--
                    <th width="120">促销操作</th>
                    -->
                </tr>
            </thead>
            <tbody>
                <volist name="list" id="vo">
                    <tr target="sid_dv" rel="{$vo['id']}">
                        <td>
                            <input name="ids[]" value="{$vo['id']}" type="checkbox">
                        </td>
                        <td align="center">
                            {$vo['id']}
                        </td>
                        <td>
                            <a title="查看{$desc[$vo['id']]['name']}" target="dialog" width="880" height="650" rel="Content_show_{$vo['id']}" href="{:U('Content/show',array('id'=>$vo['id']))}" >{$vo['name']}</a>
							<br />
							<volist name='vo.attr' id='a'>{if $a['value']}[{$a.value}]&nbsp;&nbsp;{/if}</volist>
                        </td>
                     <td>{$vo.mname}</td>
					    <td>
                            <volist name='vo.cat' id='c'>{if $c['name']}[{$c.name}]&nbsp;&nbsp;{/if}</volist>
							<!--
							<a class="add" href="{:U('Category/add')}" target="dialog" width="600" height="380" title="添加分类"><span>+</span></a>
							-->
                        </td>
                        <td>
                            {$brand[$vo['brand_id']]['name']}
							<!--
							<a class="add" href="{:U('Brand/add')}" target="dialog" width="600" height="380" title="添加品牌"><span>+</span></a>
							-->
                        </td>
                        <td>
                            ￥
                            <php>
                                echo $vo['price'] * 0.01
                            </php>
                        </td>
                        <td>
                            {if $vo['status']==0}
					<a title="下架"  rel="jbsxBox" class="btnxj">上下架</a>
					{else}
					<a title="上架"  rel="jbsxBox"  class="btnsj">上下架</a>
					{/if}
                        </td>
                        <td>
                            <a title="编辑{$desc[$vo['id']]['name']}" target="navTab" href="{:U('Content/add',array('id'=>$vo['id'],'catid'=>$catid))}" class="btnEdit">编辑</a>
                            <a class="btnEdit" href="{:U('Product/relevedit',array('id'=>$vo['id']))}" target="navTab" width="800" height="500" title="添加关联产品">添加关联产品</a>
                        </td>
                        <!--
                        <td>
                        <a class="btnEdit" href="{:U('Product/attredit',array('cid'=>$_GET['cid'],'id'=>$vo['id']))}" target="dialog" width="500" height="680" title="添加属性">添加属性</a>
                        <a class="btnEdit" href="{:U('Product/edit',array('cid'=>$_GET['cid'],'id'=>$vo['id']))}" target="navTab" title="编辑">修改</a>
                        <a class="btnAttach" href="{:U('Product/photo?id='.$vo['id'])}" target="dialog" width="600" height="380"><span>上传图片</span></a>
                        <a class="btnEdit" href="{:U('Product/img_list',array('id'=>$vo['id']))}" target="navTab" title="图片列表">图片列表</a>
                        </td>
                        <td>
                        <a class="btnEdit" href="{:U('Sales/ju_list',array('id'=>$vo['id']))}" target="navTab" title="聚划算列表">聚划算列表</a>
                        <a class="btnEdit" href="{:U('Sales/package_select',array('id'=>$vo['id']))}" target="dialog" width="600" height="400" title="添加到套餐">添加到套餐</a>
                        </td>
                        -->
                    </tr>
                </volist>
            </tbody>
        </table>
    </div>
    <include file="Index:pages" />
</div>
<script type="text/javascript">
    function dialogAjaxDone(json){
        $.pdialog.closeCurrent();
    }
	function navTabAjaxDone(json){
    if(json.action == 'upmanme'){
		var url = "{:U('Product/mname',array('ftodo'=>'edit'))}" + '&ids='+json.ids +'&ftodo='+json.ftodo;
		$("#forstautss2").attr('href',url);
        $("#forstautss2").click();
	} else {
		DWZ.ajaxDone(json);
		navTab.reload();
	}
}
</script>
